package fakeopentypedialog.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
import org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.HandlerUtil;

import fakeopentypedialog.FakeOpenTypeContainer;

/**
 * Our sample handler extends AbstractHandler, an IHandler base class.
 * 
 * @see org.eclipse.core.commands.IHandler
 * @see org.eclipse.core.commands.AbstractHandler
 */
public class FakeOpenTypeDialogHandlerOk extends AbstractHandler {
    /**
     * The constructor.
     */
    
    public FakeOpenTypeDialogHandlerOk() {
    }

    /**
     * the command has been executed, so extract extract the needed information
     * from the application context.
     */
    
    public Object execute(ExecutionEvent event) throws ExecutionException {
	/*IWorkbenchWindow window = HandlerUtil
		.getActiveWorkbenchWindowChecked(event);
	MessageDialog.openInformation(window.getShell(), "FakeOpenTypeDialog",
		"Hello, Eclipse world");
		*/
	FakeOpenTypeContainer.getInstance().postEnter();
	return null;
	
    }

    

}
